import os
from typing import Annotated, Union

from fastapi import Depends, FastAPI
import uvicorn
# import sys
# sys.path.append("..")
from feishu.api import feishu_send
from feishu.model.alertmanager import alertmode
from loguru import logger




app = FastAPI()
# @app.get("/")
# def root():
#     return {"message": "Fast API in Python"}
# @app.get("/user")
# def read_user():
#     return api.read_user()
#此接口不需要secret

@app.post("/feishu/{token}")
async def fei_token(token: str, data: alertmode):
    data=data.model_dump()
    return feishu_send.send(token=token,data=data)
@app.post("/send")
async def fei_send(data: alertmode):
    data=data.model_dump()
    return feishu_send.send_sign(data=data)



   

    